package com.olt.controller.LogController;

import com.olt.domain.log.OltLog;
import com.olt.domain.user.OltRole;
import com.olt.result.ErrorEnum;
import com.olt.result.PageResult;
import com.olt.server.dto.PageInput;
import com.olt.server.log.LogServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import util.PageUtil;

@RestController
public class LogController {
    @Autowired
    LogServer logServer;

    @PostMapping(value = "logs/getLoges")
    public PageResult<OltLog> getRoles(@RequestBody PageInput input){
        var res=new PageResult<OltLog>();
        var page=logServer.getOltLog(input);
        PageUtil.setPageRes(res,page);
        res.setError(ErrorEnum.Success_Http);
        return res;
    }
}
